package com.qingxin.sys.entity;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.codehaus.jackson.annotate.JsonIgnore;
import org.hibernate.annotations.GenericGenerator;

import com.qingxin.park.entity.ParkNotify;

/**
 * 通知表
 */
@Entity
@Table(name = "notify")
public class Notify extends com.qingxin.sys.entity.BaseEntity implements
		java.io.Serializable {
	private static final long serialVersionUID = 105947912942383058L;
	
	private String notifyId;
	private String type;
	private String code;
	private String title;
	private String notifyContent;
	private String status;
	private String createBy;
	private Date createTime;
	private String updateBy;
	private Date upadteTime;
	private String sendBy;
	private Date sendTime;
	private Set<NotityAttachement> notityAttachements = new HashSet<>(0);
	private Set<ParkNotify> parkNotifies = new HashSet<>(0);
	private Set<UserNotify> userNotifies = new HashSet<>(0);

	// Constructors

	/** default constructor */
	public Notify() {
	}

	/** full constructor */
	public Notify(String type, String code, String title, String notifyContent,
			String status, String createBy, Date createTime,
			String updateBy, Date upadteTime, String sendBy,
			Date sendTime, Set<NotityAttachement> notityAttachements,
			Set<ParkNotify> parkNotifies, Set<UserNotify> userNotifies) {
		this.type = type;
		this.code = code;
		this.title = title;
		this.notifyContent = notifyContent;
		this.status = status;
		this.createBy = createBy;
		this.createTime = createTime;
		this.updateBy = updateBy;
		this.upadteTime = upadteTime;
		this.sendBy = sendBy;
		this.sendTime = sendTime;
		this.notityAttachements = notityAttachements;
		this.parkNotifies = parkNotifies;
		this.userNotifies = userNotifies;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "notify_id", unique = true, nullable = false, length = 32)
	public String getNotifyId() {
		return this.notifyId;
	}

	public void setNotifyId(String notifyId) {
		this.notifyId = notifyId;
	}

	@Column(name = "type", length = 1)
	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@Column(name = "code", length = 20)
	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	@Column(name = "title", length = 100)
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "notify_content")
	public String getNotifyContent() {
		return this.notifyContent;
	}

	public void setNotifyContent(String notifyContent) {
		this.notifyContent = notifyContent;
	}

	@Column(name = "status", length = 1)
	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Column(name = "create_by", length = 32)
	public String getCreateBy() {
		return this.createBy;
	}

	public void setCreateBy(String createBy) {
		this.createBy = createBy;
	}

	@Column(name = "create_time", length = 23)
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Column(name = "update_by", length = 32)
	public String getUpdateBy() {
		return this.updateBy;
	}

	public void setUpdateBy(String updateBy) {
		this.updateBy = updateBy;
	}

	@Column(name = "upadte_time", length = 23)
	public Date getUpadteTime() {
		return this.upadteTime;
	}

	public void setUpadteTime(Date upadteTime) {
		this.upadteTime = upadteTime;
	}

	@Column(name = "send_by", length = 32)
	public String getSendBy() {
		return this.sendBy;
	}

	public void setSendBy(String sendBy) {
		this.sendBy = sendBy;
	}

	@Column(name = "send_time", length = 23)
	public Date getSendTime() {
		return this.sendTime;
	}

	public void setSendTime(Date sendTime) {
		this.sendTime = sendTime;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "notify")
	@JsonIgnore
	public Set<NotityAttachement> getNotityAttachements() {
		return this.notityAttachements;
	}

	public void setNotityAttachements(Set<NotityAttachement> notityAttachements) {
		this.notityAttachements = notityAttachements;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "notify")
	@JsonIgnore
	public Set<ParkNotify> getParkNotifies() {
		return this.parkNotifies;
	}

	public void setParkNotifies(Set<ParkNotify> parkNotifies) {
		this.parkNotifies = parkNotifies;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "notify")
	@JsonIgnore
	public Set<UserNotify> getUserNotifies() {
		return this.userNotifies;
	}

	public void setUserNotifies(Set<UserNotify> userNotifies) {
		this.userNotifies = userNotifies;
	}

}